"""Build rsvc"""
import daos_build

def scons():
    """Execute build"""
    Import('env', 'prereqs')

    if not prereqs.server_requested():
        return

    # rsvc-specific env
    denv = env.Clone()

    prereqs.require(denv, 'argobots', 'protobufc', 'hwloc')

    # ds_rsvc
    ds_rsvc = daos_build.library(denv, 'rsvc', ['srv.c',
                                                'srv_common.c',
                                                'rpc.c'],
                                 install_off="../..")
    denv.Install('$PREFIX/lib64/daos_srv', ds_rsvc)

if __name__ == "SCons.Script":
    scons()
